<Page
    x:Class="AppStudio.Views.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:AppStudio.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
 
  <Grid Background="{StaticResource AppBackground}">
    <Grid.ChildrenTransitions>
      <TransitionCollection>
        <EntranceThemeTransition/>
      </TransitionCollection>
    </Grid.ChildrenTransitions>

    <Hub x:Name="Container"  DataContext="{Binding}" Header="{Binding NavigationHelper}" HeaderTemplate="{StaticResource PageHeader}" SectionHeaderClick="OnSectionHeaderClick" Style="{StaticResource AppHubStyle}" SectionsInViewChanged="OnSectionsInViewChanged">
      <HubSection x:Name="DerBDVBSection" Header="Der BDVB" DataContext="{Binding MainViewModel.DerBDVBModel}" ContentTemplate="{StaticResource DerBDVBList}" IsHeaderInteractive="{Binding HasMoreItems}" Style="{StaticResource AppHubSectionStyle}" />
      <HubSection x:Name="GliederungenSection" Header="Gliederungen" DataContext="{Binding MainViewModel.GliederungenModel}" ContentTemplate="{StaticResource GliederungenList}" IsHeaderInteractive="{Binding HasMoreItems}" Style="{StaticResource AppHubSectionStyle}" />
      <HubSection x:Name="FacebookSection" Header="Facebook" DataContext="{Binding MainViewModel.FacebookModel}" ContentTemplate="{StaticResource FacebookList}" IsHeaderInteractive="{Binding HasMoreItems}" Style="{StaticResource AppHubSectionStyle}" />
      <HubSection x:Name="KontaktSection" Header="Kontakt" DataContext="{Binding MainViewModel.KontaktModel}" ContentTemplate="{StaticResource KontaktList}" IsHeaderInteractive="{Binding HasMoreItems}" Style="{StaticResource AppHubSectionStyle}" />
      <HubSection x:Name="AboutSection" Header="About" DataContext="{Binding MainViewModel.AboutModel}" ContentTemplate="{StaticResource AboutList}" IsHeaderInteractive="{Binding HasMoreItems}" Style="{StaticResource AppHubSectionStyle}" />
    </Hub>

    <VisualStateManager.VisualStateGroups>
      <VisualStateGroup>
        <VisualState x:Name="SnappedView">
          <Storyboard>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DerBDVBSection" Storyboard.TargetProperty="ContentTemplate">
              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DerBDVBListSnapped}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GliederungenSection" Storyboard.TargetProperty="ContentTemplate">
              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource GliederungenListSnapped}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FacebookSection" Storyboard.TargetProperty="ContentTemplate">
              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FacebookListSnapped}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="KontaktSection" Storyboard.TargetProperty="ContentTemplate">
              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource KontaktListSnapped}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="AboutSection" Storyboard.TargetProperty="ContentTemplate">
              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AboutListSnapped}"/>
            </ObjectAnimationUsingKeyFrames>
          </Storyboard>
        </VisualState>
        <VisualState x:Name="FullscreenView">
        </VisualState>
      </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
  </Grid>

  <Page.BottomAppBar>
    <CommandBar Background="{StaticResource AppBarBackground}">
      <AppBarButton x:Uid="RefreshButton" DataContext="{Binding MainViewModel}" Command="{Binding RefreshCommand}">
        <AppBarButton.Icon>
          <BitmapIcon UriSource="ms-appx:///Assets/AppBar/Refresh.png"/>
        </AppBarButton.Icon>
      </AppBarButton>
    </CommandBar>
  </Page.BottomAppBar>
</Page>
